package com.zerox.service.impl;

import com.zerox.mapper.SysSupplierMapper;
import com.zerox.pojo.Supplier;
import com.zerox.service.SysSupplierService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class SysSupplierServiceImpl implements SysSupplierService {

    @Autowired
    private SysSupplierMapper sysSupplierMapper;
    @Override
    public List<Supplier> list(Integer pageNos, Integer pageSize) {
        Integer startIndex = (pageNos-1) * pageSize;
        return sysSupplierMapper.list(startIndex,pageSize);
    }

    @Override
    public Integer count() {
        return sysSupplierMapper.count();
    }

    @Override
    public int add(Supplier supplier) {
        return sysSupplierMapper.add(supplier);
    }

    @Override
    public Supplier selectById(Integer id) {
        return sysSupplierMapper.selectById(id);
    }

    @Override
    public int delete(Integer id) {
        return sysSupplierMapper.delete(id);
    }

    @Override
    public int update(Supplier supplier) {
        return sysSupplierMapper.update(supplier);
    }

    @Override
    public Supplier selectBysupCode(String supCode) {
        return sysSupplierMapper.selectBysupCode(supCode);
    }

    @Override
    public Supplier selectId(Integer id) {
        return sysSupplierMapper.selectId(id);
    }
}